package com.ay.weixin.config.group.db;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import lizar.db.ibatis.Dao;

import com.ay.weixin.config.group.ProjectGroupVar;

public class IbatisProjectGroupVarDao extends Dao {

	public List<ProjectGroupVar> getAll() throws SQLException{
		return (List<ProjectGroupVar>)this.sqlMapper.queryForList("project_group_var.getAll");
	}
	
	public List<ProjectGroupVar> getByProjectId(long project_id) throws SQLException{
		return (List<ProjectGroupVar>)this.sqlMapper.queryForList("project_group_var.getByProjectId",project_id);
	}
	
	public void insert(ProjectGroupVar var) throws SQLException{
		this.sqlMapper.insert("project_group_var.insert",var);
	}
	
	public void deleteById(long id) throws SQLException{
		this.sqlMapper.delete("project_group_var.deleteById",id);
	}

	
	public void deleteByProjectId(long project_id) throws SQLException{
		this.sqlMapper.delete("project_group_var.deleteByProjectId",project_id);
	}
	
	
	public void updateById(long id,String value) throws SQLException{
		Map<String,Object> params=new HashMap<String,Object>();
		params.put("id",id);
		params.put("value", value);
		this.sqlMapper.delete("project_group_var.updateById",params);
	}
	
}
